package ch6;

/**
 * @author ANG.YU
 * @date 2020-08-11 16:17
 */
public class Orc extends Villain {
    private int j;

    public Orc(int jj) {
        super(jj);
        j = jj;
    }

    //change()拥有对 set()的访问权限，因为它的属性是 protected（受到保护的）
    public void change(int x) {
        set(x);
    }

}

class Villain {
    private int i;

    public Villain(int ii) {
        i = ii;
    }

    protected int read() {
        return i;
    }

    protected void set(int ii) {
        i = ii;
    }

    public int value(int m) {
        return m * i;
    }
}
